<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			class Human{
				constructor(name,age,addr){
					this.name=name;
					this.age=age;
					this.addr=addr;
				}
				selfIntro(){
					alert("我叫"+this.name+",今年"+this.age+",住在"+this.addr);
				}
				pastOneYear(){
					this.age++;
				}
				beat(p){
					alert(p+"得罪了"+this.name+",被暴打");
				}
			}
			/*var h=new Human("王飞",21,"蜂巢园");
			h.selfIntro();
			h.pastOneYear();
			h.selfIntro();
			h.beat("西门庆");*/
			class Man extends Human
			{
				constructor(name,age,addr,job){
					super(name,age,addr);
					this.job=job;
				}
				selfIntro(){
					super.selfIntro();
					alert("职业是"+this.job);
				}
				beat(p){
					alert(p+"得罪了"+this.name+",被骂的狗血喷头");
				}
			}
			var m=new Man("武松",21,"清河县紫石街","刑警队长");
			m.selfIntro();
			m.pastOneYear();
			m.selfIntro();
			m.beat("西门吹雪");
			
			var m2=new Man("王子彬",23);
			m2.selfIntro();
		</script>
	</head>
	<body>
	</body>
</html>
